package com.xijia.spring.listener;

import com.xijia.spring.entity.UserMessageEntity;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;


/**
 * 监听发送邮件
 */
@Component
public class SmSListener implements ApplicationListener<UserMessageEntity> {
    /**
     * 监听的方法
     *
     * @param event
     */
    @Override
    @Async
    public void onApplicationEvent(UserMessageEntity event) {
        System.out.println(Thread.currentThread().getName() + "  短信:" + event.toString());
    }
}
